package service;

import dao.TeacherDao;
import domain.Teacher;

import java.util.ArrayList;

public class TeacherService {
   private TeacherDao teacherDao = new TeacherDao();

    public  void update(String sid, Teacher teacher) {
        teacherDao.update(sid,teacher);
    }



    public boolean isExists(String sid) {
      ArrayList<Teacher>list= teacherDao.find();
        for (int i = 0; i < list.size(); i++) {
            Teacher teacher = list.get(i);
            if (teacher.getSid().equals(sid)){
                return true;
            }
        }
        return false;
    }

    public  void addteacher(Teacher teacher) {
        teacherDao.addteacher(teacher);
    }

    public ArrayList<Teacher> find() {
        return null;
    }

    public void delete(String sid) {
        teacherDao.delete(sid);
    }
}
